'use strict';

var Mock = require('mockjs/dist/mock.js');


Mock.mock('user/getUserInfo.do', function(options) {
  return {
    status: 'OK',
    message: '获取用户信息',
    result: null/* {
      userName: 'admin',
      password: '1234567'
    }*/,
    code: '200'
  };
})
Mock.mock('user/sendCode.do', function(options) {
  return {
    status: 'OK',
    message: '获取用户信息',
    result: 'https://ss2.baidu.com/6ONYsjip0QIZ8tyhnq/it/u=4057308320,801662663&fm=58'/*{
     userName: 'admin',
     password: '1234567'
     }*/,
    code: '200'
  };
})

Mock.mock('user/compareCode.do', function(options) {
  return {
    status: 'OK',
    message: '获取成功',
    result: {
      code: '1234567'
    },
    code: '200'
  };
})

Mock.mock('user/getOrderList.do', function(options) {
	return {
		status: 'OK',
		message: 'success',
		result: {
			list: [
				{
			      "orderId": "1",
			      "customerName": "南通卫生局",
			      "partnerName": "神码一部",
			      "type": "1",
			      "productName": "DAAS平台标准版（产品名称）",
			      "date": "今日",
			      "status": "1",
			      "total_price": "¥300,000"
			    },{
			      "orderId": "2",
			      "customerName": "无锡卫生局",
			      "partnerName": "神码二部",
			      "type": "2",
			      "productName": "DAAS平台标准版（含200API）",
			      "date": "今日",
			      "status": "1",
			      "total_price": "600,000"
			    },{
			      "orderId": "3",
			      "customerName": "苏州卫生局",
			      "partnerName": "神码一部",
			      "type": "1",
			      "productName": "DAAS平台标准版（产品名称）",
			      "date": "6月10日",
			      "status": "1",
			      "total_price": "¥300,000"
			    }
			],
			page: {
				pageNo: 1,
				total: 1
			}
		},
		code: '200'
	};
})

Mock.mock('customer/list.do', function(options) {
	return {
		status: 'OK',
		message: 'success',
		result: {
			customerList: [
				{
					customer: {
						id: 1,
						name: '阿里巴巴',
						location: '北京 东城区',
						address: '人民路188号'
					},
					contactList: [
						{
							id: 9001,
							name: '马云',
							telephone: '13772822222'

						},{
							id: 9002,
							name: '马云2',
							telephone: '13772823333'
						}
					]
				},{
					customer: {
						id: 2,
						name: '阿里妈妈',
						location: '北京 西城区',
						address: '人民路189号'
					},
					contactList: [
						{
							id: 9022,
							name: '妈妈A',
							telephone: '13772822222'
						},{
							id: 9023,
							name: '妈妈B',
							telephone: '13772823333'
						}
					]
				}
			]
		},
		code: '200'
	};
})

Mock.mock('customer/add.do', 'post', function(options) {
	return {
		status: 'OK',
		message: 'success',
		result: '',
		code: '200'
	};
})

Mock.mock('customer/update.do', 'post', function(options) {
	return {
		status: 'OK',
		message: 'success',
		result: '',
		code: '200'
	};
})

Mock.mock('partner/list.do', function(options) {
	return {
		status: 'OK',
		message: 'success',
		result: {
			partnerList: [
				{
					partner: {
						id: 1,
						name: '特能讯',
						location: '北京 东城区',
						address: '人民路188号'
					},
					contactList: [
						{
							id: 9001,
							name: '马化腾1',
							telephone: '13772822222'

						},{
							id: 9002,
							name: '马化腾2',
							telephone: '13772823333'
						}
					]
				},{
					partner: {
						id: 2,
						name: '新浪',
						location: '北京 西城区',
						address: '人民路189号'
					},
					contactList: [
						{
							id: 9022,
							name: '曹国伟1',
							telephone: '13772822222'
						},{
							id: 9023,
							name: '曹国伟2',
							telephone: '13772823333'
						}
					]
				}
			],
			page: {
				pageNo: 1,
				total: 1
			}
		},
		code: '200'
	};
})
